package com.da.javatest.leetCode;

import java.util.Arrays;

/**
 * @author chenlida
 * @date 2018/12/15 16:52
 * @description
 */
public class Code852 {
    public int peakIndexInMountainArray(int[] A) {
        int max = Arrays.stream(A).max().getAsInt();
        for (int i = 0; i < A.length; i++) {
            if (A[i] == max) {
                return i;
            }
        }
        return -1;
    }
}
